
#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    if (ui->radioButton_os_type_installed->isChecked()) {
        toggle_os_type(OSType::Installed);
    } else if (ui->radioButton_os_type_iso->isChecked()) {
        toggle_os_type(OSType::ISO);
    }
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::toggle_os_type(OSType os_type)
{
    switch (os_type) {
    case OSType::Installed:
        ui->label_title_removed_list->setEnabled(false);
        ui->comboBox_removed_list->setEnabled(false);
        ui->pushButton_removed_list->setEnabled(false);
        break;
    case OSType::ISO:
        ui->label_title_removed_list->setEnabled(true);
        ui->comboBox_removed_list->setEnabled(true);
        ui->pushButton_removed_list->setEnabled(true);
        break;
    default:
        break;
    }
}

void MainWindow::on_radioButton_os_type_installed_clicked(bool checked)
{
    if (checked) {
        toggle_os_type(OSType::Installed);
    }
}

void MainWindow::on_radioButton_os_type_iso_clicked(bool checked)
{
    if (checked) {
        toggle_os_type(OSType::ISO);
    }
}

